// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3)
// Source File Name: SearchForm.java

package com.market.web.form;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.market.web.action.BaseAction;

public class SearchForm extends ActionForm
{

    static final Logger logger = LoggerFactory.getLogger(BaseAction.class);
    /**
     * 
     */
    private static final long serialVersionUID = -99279687715297578L;

    public SearchForm()
    {
        action = "";
        type = "";
        orderBy = "";
        name = "";
        parameter = "";
        category = "";
    }

    public String getCategory()
    {
        return category;
    }

    public void setCategory(String category)
    {
        this.category = category;
    }

    public String getAction()
    {
        return action;
    }

    public void setAction(String action)
    {
        this.action = action;
    }

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public String getOrderBy()
    {
        return orderBy;
    }

    public void setOrderBy(String orderBy)
    {
        this.orderBy = orderBy;
    }

    public String getType()
    {
        return type;
    }

    public void setType(String type)
    {
        this.type = type;
    }

    public ActionErrors validate(ActionMapping mapping, HttpServletRequest reqeust)
    {
      /*  if (!"bowb".equals(category) && !"arrow".equals(category) && !"ball".equals(category)
                && !"collimator".equals(category) && !"safety".equals(category))
        {
            category = "bowa";
        }*/
        
        
        if(logger.isDebugEnabled())
        {
            logger.debug("category xxxxxxxxxx is"+category);
        }
            
        if (!"rice".equals(category) && !"beer".equals(category))
        {
            category = "rice";
        }
        
        if (!"hot".equals(orderBy) && !"adddate".equals(orderBy) && !"vipprice".equals(orderBy))
        {
            orderBy = "price";
        }
        return null;
    }

    public String getParameter()
    {
        return parameter;
    }

    public void setParameter(String parameter)
    {
        this.parameter = parameter;
    }

    private String action;

    private String type;

    private String orderBy;

    private String name;

    private String parameter;

    private String category;
}
